package com.unsk.item.player
{
	import Box2D.Dynamics.b2Body;
	
	import com.alex.game.framework.BasicItem;
	import com.alex.game.framework.GG;
	import com.alex.game.framework.Input;
	import com.unsk.util.Log;
	
	import flash.display.Sprite;
	
	public class Player extends BasicItem 
	{
		public var body:b2Body;
		
		public function Player(body:b2Body):void
		{
			this.body = body;	
		}
		override public function create():void
		{
			Log.debug(this, "Create");
			var display:Sprite = new Sprite();
			display.graphics.beginFill(0x999999);
			display.graphics.drawCircle(0,0,30);
			display.graphics.endFill();
			this.addChild(display);
		}
		override public function destroy():void
		{
			
		}
		override public function update():void
		{
			body.WakeUp();
			
			this.x = body.GetPosition().x * GG.RATIO;
			this.y = body.GetPosition().y * GG.RATIO;
		}
	}
}